﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lyh.Models;
using Lyh.Repository;
using Lyh.Repository.Impl;

namespace Lyh.Facade.Impl
{
    public class UserFacade : IUserFacade
    {
        private readonly IUserRepository userRepository;
        public UserFacade(IUserRepository userRepository)
        {
            this.userRepository = userRepository ?? new UserRepository();
        }
        public User Load(string id)
        {
            return userRepository.Load(id);
        }

        public User Get(string id)
        {
            return userRepository.Get(id);
        }

        public void SaveOrUpdate(User user)
        {
            userRepository.SaveOrUpdate(user);
        }
    }
}
